package pers.liyan.shi.springcloud.consumeruser.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pers.liyan.shi.springcloud.producerticketclient.domain.Ticket;
import pers.liyan.shi.springcloud.consumeruser.service.UserService;

/**
 * userController
 *
 * @author shily
 * @date 2019/4/21 1:34
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService service;

    /**
     * 买票方法
     *
     * @param movieName 电影名称
     * @param userName  用户名
     * @return pers.liyan.shi.springcloud.producerticketclient.domain.Ticket
     * @author shily
     * @date 2019/4/21 1:35
     */
    @GetMapping()
    public Ticket buyTicket(@RequestParam("movieName") String movieName, @RequestParam("userName") String userName) {
        return service.buyTicket(movieName, userName);
    }


}
